package com.zzw.dao;

import com.zzw.bean.Wallet;
import com.zzw.bean.WalletExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;

public interface WalletMapper extends BaseMapper<Wallet> {
    long countByExample(WalletExample example);

    int deleteByExample(WalletExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Wallet record);

    int insertSelective(Wallet record);

    List<Wallet> selectByExample(WalletExample example);

    Wallet selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Wallet record, @Param("example") WalletExample example);

    int updateByExample(@Param("record") Wallet record, @Param("example") WalletExample example);

    int updateByPrimaryKeySelective(Wallet record);

    int updateByPrimaryKey(Wallet record);
    
    /**
     * 获取页脚统计数据
     * @param wallet 查询条件
     * @return 统计数据
     */
    List<Wallet> getFooterData(Wallet wallet);
    
    /**
     * 按分类统计支出金额
     * @param wallet 查询条件
     * @return 支出分类统计数据
     */
    List<Wallet> selectExpenseGroupByCategory(Wallet wallet);
    
    /**
     * 按月统计收支数据
     * @param type 交易类型（1:支出, 2:收入）
     * @param wallet 查询条件
     * @return 月度统计数据
     */
    List<Map<String, Object>> selectMonthlyStatistics(@Param("type") Byte type, @Param("wallet") Wallet wallet);
}
